package com.hgd.security.evp.swagger.filter;

import javax.servlet.*;
import javax.servlet.http.HttpServletRequest;
import java.io.IOException;

/**
 * @author ：尚村山夫
 * @date ：Created in 2019/8/13 21:55
 * @modified By：
 */
//@WebFilter(urlPatterns = "/*",filterName = "SwaggerFilter")
public class SwaggerFilter implements Filter {

    @Override
    public void init(FilterConfig filterConfig) throws ServletException {

    }

    @Override
    public void doFilter(ServletRequest servletRequest, ServletResponse servletResponse, FilterChain filterChain)
        throws IOException, ServletException {
        HttpServletRequest request = (HttpServletRequest) servletRequest;
        String requestURI = request.getRequestURI();
        System.out.println("requestUrl in SwaggerFIlter::"+requestURI);

        long startTime = System.currentTimeMillis();

        filterChain.doFilter(servletRequest, servletResponse);
    }

    @Override
    public void destroy() {

    }
}
